from .control import Control
from .button import Button
from .indicator import Indicator


class ScrollBar(Control):
    '''
    滚动条操作
    '''

    def get_indicator(self):
        '''
        获取滑块

        :Returns:
            返回滑块对象
        '''
        indicator = self.control.GetIndicator
        return Indicator(indicator)

    def get_page_size(self):
        '''
        获取页

        :Returns:
            返回页
        '''
        return self.control.GetPageSize

    def get_min_value(self):
        '''
        获取最小值

        :Returns:
            返回最小值
        '''
        return self.control.GetMinValue

    def get_max_value(self):
        '''
        获取最大值

        :Returns:
            返回最大值
        '''
        return self.control.GetMaxValue

    def get_right_button(self):
        '''
        获取此滚动条的右侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetRightButton
        return Button(button)

    def get_left_button(self):
        '''
        获取此滚动条的左侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetLeftButton
        return Button(button)

    def get_down_button(self):
        '''
        获取此滚动条的下侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetDownButton
        return Button(button)

    def get_up_button(self):
        '''
        获取此滚动条的上侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetUpButton
        return Button(button)

    def get_page_right_button(self):
        '''
        获取此滚动条的页面右侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetPageRightButton
        return Button(button)

    def get_page_left_button(self):
        '''
        获取此滚动条的页面左侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetPageLeftButton
        return Button(button)

    def get_page_down_button(self):
        '''
        获取此滚动条的页面下侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetPageDownButton
        return Button(button)

    def get_page_up_button(self):
        '''
        获取此滚动条的页面上侧按钮

        :Returns:
            返回按钮
        '''
        button = self.control.GetPageUpButton
        return Button(button)

    def get_value(self):
        '''
        获取滚动条的当前滚动值

        :Returns:
            返回滚动条的当前滚动值
        '''
        return self.control.GetValue

    def set_value(self, value):
        '''
        设置滚动条的当前滚动值

        :Args:
         - value: 滚动条的当前滚动值
        '''
        self.control.SetValue(value)


